UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H+yJOA4iwowVwwbKLmXGls7rI9QFBXpIs+1XEABFyJU=' 
WHERE 
  key_id = '36bffda6926700ae91589baaac80f7ed6c1707147def0c34154c672dc5f89d06' 
  AND (
    token = 'H+yJOA4iwowVwwbKLmXGls7rI9QFBXpIs+1XEABFyJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038