UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DGvezThAIWqJcbm9Lnh3v5lWN5U3qrnC/AdFXk01Az4=' 
WHERE 
  key_id = '70c2784bdef04a62a65e5010b6bdb53fa5cc789605f26c1f3e2aa5447701ba3f' 
  AND (
    token = 'DGvezThAIWqJcbm9Lnh3v5lWN5U3qrnC/AdFXk01Az4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054