UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zw8oaaennyjbzt+btWV0uwXnbXyS4o0agHJ+4PAcW84=' 
WHERE 
  key_id = '9df8d2faac0d1a27c764e1926651e1f08b50106e585ad6ea1950a76b8e10e6e7' 
  AND (
    token = 'zw8oaaennyjbzt+btWV0uwXnbXyS4o0agHJ+4PAcW84=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042