UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1xwvxqENoIHKEDaeKYfv1AaMwQ+/YEnwAh82SsbIJAE='
WHERE
key_id = '38fc6a24eae84b7fa726832cc4f1155a758c0b9cb77801d0c169bf061fe5e402'
AND (
token = '1xwvxqENoIHKEDaeKYfv1AaMwQ+/YEnwAh82SsbIJAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)