UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jJDyiP75nKvRzofjg5809N7Wajm4TNBfrj72qoVPVTc=' 
WHERE 
  key_id = '2bddfc1f6a1ffb1072803187b073a44f62a2fd4e92416968a02a25f94387d48a' 
  AND (
    token = 'jJDyiP75nKvRzofjg5809N7Wajm4TNBfrj72qoVPVTc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064