UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gJp65D+tsEYosOloTzf2UpDVvMg68ddJw0SGIsoQHy0='
WHERE
key_id = '7a4aa44c8e3078823d89bd068850dbd00e1dff5a7af9d3d669fbaff8ecc3acc9'
AND (
token = 'gJp65D+tsEYosOloTzf2UpDVvMg68ddJw0SGIsoQHy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)