UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4w27FhRPmuf1ts8v6jSYMbDkKdcluV8LG2Sw2W85IQw=' 
WHERE 
  key_id = '9ab08bed38ba3a96cee3f0771836898fcf1077696db20afdf5888652526017af' 
  AND (
    token = '4w27FhRPmuf1ts8v6jSYMbDkKdcluV8LG2Sw2W85IQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036