UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '92NIpmHQHWDziHzr1XovSS8gLJBB7+IDYHGi9gfE43Q='
WHERE
key_id = '52b2214d3a57ea5bbb30d7866f8353fed35ff9c57e848fb6f5d7e9c24ad2b4ec'
AND (
token = '92NIpmHQHWDziHzr1XovSS8gLJBB7+IDYHGi9gfE43Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)