UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XB/+xcwoGGYVmGhzj61NJ9lMDJaqZKbgMZ5XFtJG5g0=' 
WHERE 
  key_id = '7fbf8559dbab6b557e546c88c231b7828c073037069e6af5576008bb6c3cd158' 
  AND (
    token = 'XB/+xcwoGGYVmGhzj61NJ9lMDJaqZKbgMZ5XFtJG5g0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030