UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ljQzmmTl/aeoWURL43bS65WX/NOz6zAq/hBW+QAMEZc='
WHERE
key_id = 'f423128da7ba25b2440f60f694a74ba0601fad15ec1a7c9a49dc72fa192939cb'
AND (
token = 'ljQzmmTl/aeoWURL43bS65WX/NOz6zAq/hBW+QAMEZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)