UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oVk3XbRD5/XVpTgSVNue7phW31hjFavyE1aOpXHzaYE='
WHERE
key_id = '19fd2144bb5f81c748980b14ac622d83473b21530817c0205787fc4263b3bd21'
AND (
token = 'oVk3XbRD5/XVpTgSVNue7phW31hjFavyE1aOpXHzaYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)