UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1jrcQuRed2K4ZoIvluNK/LdqtdsfoHT2LlYN/+sn28o='
WHERE
key_id = '79f9812a1721a501c2f734e15938fe224a58577ff0ae9efedb1c34ce9bb74388'
AND (
token = '1jrcQuRed2K4ZoIvluNK/LdqtdsfoHT2LlYN/+sn28o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)