UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SLlBJSnFQJ8SyKLnMrCcetvLQv46yy6zaJwf6KabvBY='
WHERE
key_id = '63ee0c29cdcc5899b25eaca78cd125df683976b7fdaf3e3433990490ade9b6e4'
AND (
token = 'SLlBJSnFQJ8SyKLnMrCcetvLQv46yy6zaJwf6KabvBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)