UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qq21iUB4G1fW3Zqe+YTyzM9lL9sAymkQr+90XmDqCm0=' 
WHERE 
  key_id = 'ffa073c6c1193f945952cd4e503e2974783acd00ff2e05be688531d225c740ea' 
  AND (
    token = 'qq21iUB4G1fW3Zqe+YTyzM9lL9sAymkQr+90XmDqCm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00106