UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fo6iOjZ4PiyKcAw3+mVaq8yFYsxO7YCS6oLVHZFGhdA=' 
WHERE 
  key_id = '458d0ea722aec38df126ce42c5b505c97d1b67d60e6f4f7c188b9f7e94b7b8e8' 
  AND (
    token = 'Fo6iOjZ4PiyKcAw3+mVaq8yFYsxO7YCS6oLVHZFGhdA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031