UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Y6sm+RSjTQZ2cb8to3rSnDTH4w8RoAAAvoNtUoR1j4=' 
WHERE 
  key_id = '903c09a7e28631c8513b66729bef51193e0bbbc74ef35717cb59ab6cedbb8d62' 
  AND (
    token = '6Y6sm+RSjTQZ2cb8to3rSnDTH4w8RoAAAvoNtUoR1j4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030