UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UPa2178/Sbey7gF9/M4XWMFzaBaKRgKeG9mKng8qfG4='
WHERE
key_id = '2d2e81ccfdc976ad18005cc1f6a35516c175a4f58381d540098960b5282b9db7'
AND (
token = 'UPa2178/Sbey7gF9/M4XWMFzaBaKRgKeG9mKng8qfG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)