UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OiTR4rT0F7uSx+/rqkpwC2lcD4+v5HYKnXAEOi/zFok='
WHERE
key_id = 'c28eaceace3270b7a9e7cb7c8115e5ed2573cbb16d335d91eecdc3d9d2f9a033'
AND (
token = 'OiTR4rT0F7uSx+/rqkpwC2lcD4+v5HYKnXAEOi/zFok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)