UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+5D8KbLRiWVDdIOfW/Fr5YcNEBWcUYuhSTuKRfNbv4U='
WHERE
key_id = 'ec0d931cefb7d74a293c575a01be3ddeddecf8ff57a892b7258eb636c5e989ff'
AND (
token = '+5D8KbLRiWVDdIOfW/Fr5YcNEBWcUYuhSTuKRfNbv4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)