UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pvwqQrCYpMIb+84kBz/YnSw/QbopELNBNzcUbVc5Kng=' 
WHERE 
  key_id = 'b1240f1eab5e1e3ba9014e42f6f353c658d6ff2503a5d2570dcda2a69f241015' 
  AND (
    token = 'pvwqQrCYpMIb+84kBz/YnSw/QbopELNBNzcUbVc5Kng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045