UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ox5IhPXRueNtn8TIKGnorEiilIfgyN1/lnEkv2Vbbaw=' 
WHERE 
  key_id = '2026cf46596e7c4769a14a40b679f44d482c5c1388c2cb0d24387877fd3b3975' 
  AND (
    token = 'ox5IhPXRueNtn8TIKGnorEiilIfgyN1/lnEkv2Vbbaw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028