UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UVpkkcZBGm1xhS36WQNro2Dld5yr+Myfl+WwQgVx8kI='
WHERE
key_id = '3ea9e9934814656ae81fe7f5677bba4098126d1811bdaa7fff9f235864c1428b'
AND (
token = 'UVpkkcZBGm1xhS36WQNro2Dld5yr+Myfl+WwQgVx8kI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)