UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h8OfFYvGWzBJ+fUmutBqKxTqDP7BNPjw0N04h1z+FY0='
WHERE
key_id = '75bede27d81cc510e7f1d67411371c35fb6a01e0eb1b7cd19711432481b1598a'
AND (
token = 'h8OfFYvGWzBJ+fUmutBqKxTqDP7BNPjw0N04h1z+FY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)