UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3iu0qDS0D3Cm2fqZmMMZG3to86YrvU/pkUmfC53tYtk='
WHERE
key_id = 'b493638ce06fcfa17bfa240debfab6385cda244a4024c81133b2a7e2ba8dc710'
AND (
token = '3iu0qDS0D3Cm2fqZmMMZG3to86YrvU/pkUmfC53tYtk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)