UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '56CYCxhL1ikyDFy4rklWRqO6AXK4jtYqtgJZBiwuVmI=' 
WHERE 
  key_id = '58c35a93edd9e2f0007ebe41d413a6125387594969d428e1c82eadf9ad68d9d4' 
  AND (
    token = '56CYCxhL1ikyDFy4rklWRqO6AXK4jtYqtgJZBiwuVmI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060