UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cBxuRbT4mrncKb8TG58i0uNvOVkoQYib/u++uofZoYU=' 
WHERE 
  key_id = '554435f6e04bfc51529c3b399c82b5aa82c463dca087e4c8fd229fac1b202b93' 
  AND (
    token = 'cBxuRbT4mrncKb8TG58i0uNvOVkoQYib/u++uofZoYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037