UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h5QpHwOsNaTOLYpkSjccAt/21pqXndsmxAoRb6iyu7Y='
WHERE
key_id = '2b7fb5fc8dd0ebaf17aabf124acdcb1440aa7a0db0ecb419bcfb5ca229c5ef05'
AND (
token = 'h5QpHwOsNaTOLYpkSjccAt/21pqXndsmxAoRb6iyu7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)