UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QbvAAzwQWYs7be59BPys2KGa18X9zR4jOYFzxuOmuUA='
WHERE
key_id = 'a7059d428c2ec4948db0996762124e99f9d582adacfa5774b75fa1ecdfe70616'
AND (
token = 'QbvAAzwQWYs7be59BPys2KGa18X9zR4jOYFzxuOmuUA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)