UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VNarrqLt7apiZSbdKuf3JOGc5KoQcGmKLiCFgJJyn+c='
WHERE
key_id = '0b2a67e2917ceb628b4f3fdd026c6c8a41d021046c0859e28a661514968b1b5b'
AND (
token = 'VNarrqLt7apiZSbdKuf3JOGc5KoQcGmKLiCFgJJyn+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)