UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Mps7p31RXfFNRK16yQ6HuYpRvBmATK99T+xBkK7XIA='
WHERE
key_id = '59b268a50de82e049a34c6bd9bd79a4699757a473b40ae1f98b8d016f956ff95'
AND (
token = '8Mps7p31RXfFNRK16yQ6HuYpRvBmATK99T+xBkK7XIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)