UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rRPix0Kzl+d0mMnXjfY5rKMkbvkjqgbU7QWz9Et4+v8=' 
WHERE 
  key_id = 'd01ba3285ed2ba29ffadbe4f5fdb73443aa5bdc09a5262993fe3f05fb64aa4b6' 
  AND (
    token = 'rRPix0Kzl+d0mMnXjfY5rKMkbvkjqgbU7QWz9Et4+v8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026