UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2IGicvqj/nkgPhmCdlBvoBG9x2Lyn8nFU7hBfvLE+G8=' 
WHERE 
  key_id = '77212d81f7b195e72931168ad314d1da84299383bedf59f3308f488a06c5b48d' 
  AND (
    token = '2IGicvqj/nkgPhmCdlBvoBG9x2Lyn8nFU7hBfvLE+G8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030