UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X3kGMrB2RVmUHPTmFojSAve09pUZ3w2PHNLpQhnvhHg='
WHERE
key_id = '96358917e76e2d79963195b7a1e150ea33cca932904fa2e34ff3eb745ba79b1c'
AND (
token = 'X3kGMrB2RVmUHPTmFojSAve09pUZ3w2PHNLpQhnvhHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)