UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vZiMU/PYPSdFcVNgsQ87HHyOrmlfKaYCg1C7lvkbX3c='
WHERE
key_id = '1fd8173f4e20ef82aae4dbdaad60eb92b9bfb811cc41f6af66b069840bf23b73'
AND (
token = 'vZiMU/PYPSdFcVNgsQ87HHyOrmlfKaYCg1C7lvkbX3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)